package com.fallingsnow.sometask.utils

import android.os.CountDownTimer
import android.widget.TextView

class SkipAdsTimesUtil(
    private val skipTimer: TextView,
    private val counter: Long = 5000,
    private val finished: () -> Unit = {}
) :
    CountDownTimer(counter, 1000) {
    override fun onTick(millisUntilFinished: Long) {
        skipTimer.text = "跳过 ${(millisUntilFinished / 1000) + 1} s"
    }

    override fun onFinish() {
        finished()
    }
}